// 认证相关 API
import request from '@/utils/request'
import type { LoginParams, LoginResponse } from '@/types/user'
import type { ApiResponse } from '@/types/api'

/**
 * 登录
 */
export function login(data: LoginParams) {
  return request<ApiResponse<LoginResponse>>({
    url: '/auth/login',
    method: 'post',
    data,
  })
}

/**
 * 登出
 */
export function logout() {
  return request<ApiResponse<null>>({
    url: '/auth/logout',
    method: 'post',
  })
}

/**
 * 获取当前用户信息
 */
export function getUserInfo() {
  return request<ApiResponse<any>>({
    url: '/auth/user/info',
    method: 'get',
  })
}

